home *** CD-ROM | disk | FTP | other *** search
- /*
- *=============================================================================
- * tSippRLE.c
- *-----------------------------------------------------------------------------
- * Tcl commands to render to Utah Raster Toolkit RLE files.
- *-----------------------------------------------------------------------------
- * Copyright 1992 Mark Diekhans
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies. Mark Diekhans makes
- * no representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *-----------------------------------------------------------------------------
- * $Id: tSippRLE.c,v 2.0 1992/11/02 03:56:33 markd Rel $
- *=============================================================================
- */
-
- #include "tSippInt.h"
- #include "sipp_pixmap.h"
- #include "sipp_bitmap.h"
-
- #ifndef TSIPP_NO_RLE
-
- #include "rle.h"
-
- /*
- * Type used to hold a file handle "fileNNN".
- */
- typedef char fileHandle_t [10];
-
- /*
- * RLE file table entry.
- */
- typedef struct {
- fileHandle_t handle;
- rle_hdr rleHeader;
- } rleFile_t, *rleFile_pt;
-
- /*
- * Client-data for pixel setting call back used to hold a single row of data.
- * The data will be outputed when the last pixel is written.
- */
- typedef struct {
- rle_hdr *rleHdrPtr;
- rle_pixel **rowPtr;
- } renderData_t, *renderData_pt;
-
- /*
- * Internal prototypes.
- */
- static rleFile_pt
- RLEHandleToPtr _ANSI_ARGS_((tSippGlob_pt tSippGlobPtr,
- char *handle));
-
- static rleFile_pt
- RLECommentCmdSetup _ANSI_ARGS_((tSippGlob_pt tSippGlobPtr,
- char *handle,
- char *name));
-
- static void
- RLEPixelRender _ANSI_ARGS_((renderData_pt renderDataPtr,
- int x,
- int y,
- unsigned char red,
- unsigned char green,
- unsigned char blue));
-
- static void
- RLERenderImage _ANSI_ARGS_((tSippGlob_pt tSippGlobPtr,
- rleFile_pt rleFilePtr,
- tSippRenderParms_pt renderParmsPtr));
-
- static void
- RLEOutputBitMap _ANSI_ARGS_((tSippGlob_pt tSippGlobPtr,
- rleFile_pt rleFilePtr,
- Sipp_bitmap *bitMapPtr));
-
- static void
- RLEDrawImage _ANSI_ARGS_((tSippGlob_pt tSippGlobPtr,
- rleFile_pt rleFilePtr,
- tSippRenderParms_pt renderParmsPtr));
-
- /*=============================================================================
- * RLEHandleToPtr --
- * Utility procedure to convert a RLE file handle to a RLE header pointer.
- * Parameters:
- * o tSippGlobPtr (I) - A pointer to the Tcl SIPP global structure.
- * o handle (I) - A RLE handle.
- * Returns:
- * A pointer to the RLE file entry., or NULL if an error occured.
- *-----------------------------------------------------------------------------
- */
- static rleFile_pt
- RLEHandleToPtr (tSippGlobPtr, handle)
- tSippGlob_pt tSippGlobPtr;
- char *handle;
- {
- rleFile_pt rleFilePtr;
-
- rleFilePtr = (rleFile_pt)
- Tcl_HandleXlate (tSippGlobPtr->interp,
- tSippGlobPtr->rleTblPtr, handle);
- if (rleFilePtr == NULL)
- return NULL;
- return rleFilePtr;
-
- } /* RLEHandleToPtr */
-
- /*=============================================================================
- * SippRLEOpen --
- * Implements the command:
- * SippRLEOpen filename mode
- * Note:
- * This procedure has standard Tcl command calling sematics. ClientData
- * contains a pointer to the Tcl SIPP global structure.* We cheat by calling
- * the Tcl "open" command executor to actually do the open, that way we get the
- * full semantics of the open command.
- *-----------------------------------------------------------------------------
- */
- static int
- SippRLEOpen (clientData, interp, argc, argv)
- char *clientData;
- Tcl_Interp *interp;
- int argc;
- char **argv;
- {
- tSippGlob_pt tSippGlobPtr = (tSippGlob_pt) clientData;
- fileHandle_t fileHandle;
- rleFile_pt rleFilePtr;
- OpenFile *filePtr;
-
- if (argc != 3) {
- Tcl_AppendResult (interp, "wrong # args: ", argv [0],
- " filename mode", (char *) NULL);
- return TCL_ERROR;
- }
- /*
- * Validate mode (we restrict it since reading of RLE files in not
- * supported).
- */
- if (argv [2][1] != '\0')
- goto invalidMode;
- if (!((argv [2][0] == 'w') || (argv [2][0] == 'a')))
- goto invalidMode;
-
- /*
- * Use the open command to actually open the file. If it succeeds, save
- * the handle, which will latter be stored in the RLE file table entry.
- */
-
- if (Tcl_OpenCmd (NULL, interp, argc, argv) != TCL_OK)
- return TCL_ERROR;
- strcpy (fileHandle, interp->result);
- Tcl_ResetResult (interp);
-
- if (TclGetOpenFile (interp, fileHandle, &filePtr) != TCL_OK)
- return TCL_ERROR;
-
- /*
- * Allocate and initialize the RLE header struct, defaulting all fields.
- */
- rleFilePtr = (rleFile_pt) Tcl_HandleAlloc (tSippGlobPtr->rleTblPtr,
- interp->result);
- rleFilePtr->rleHeader = rle_dflt_hdr;
- rleFilePtr->rleHeader.rle_file = filePtr->f;
- strcpy (rleFilePtr->handle, fileHandle);
-
- return TCL_OK;
-
- invalidMode:
- Tcl_AppendResult (interp, "invalid mode \"", argv [2],
- "\" expected one of: \"w\" or \"a\"", (char *) NULL);
- return TCL_ERROR;
-
- } /* SippRLEOpen */
-
- /*=============================================================================
- * SippRLEClose --
- * Implements the command:
- * SippRLEClose rlehandle
- * Note:
- * This procedure has standard Tcl command calling sematics. ClientData
- * contains a pointer to the Tcl SIPP global structure.
- *-----------------------------------------------------------------------------
- */
- static int
- SippRLEClose (clientData, interp, argc, argv)
- char *clientData;
- Tcl_Interp *interp;
- int argc;
- char **argv;
- {
- tSippGlob_pt tSippGlobPtr = (tSippGlob_pt) clientData;
- rleFile_pt rleFilePtr;
- int result;
- char *closeArgv [2];
-
- if (argc != 2) {
- Tcl_AppendResult (interp, "wrong # args: ", argv [0],
- " rlehandle", (char *) NULL);
- return TCL_ERROR;
- }
-
- rleFilePtr = RLEHandleToPtr (tSippGlobPtr, argv [1]);
- if (rleFilePtr == NULL)
- return TCL_ERROR;
-
- closeArgv [0] = argv [0];
- closeArgv [1] = rleFilePtr->handle;
-
- result = Tcl_CloseCmd (NULL, interp, 2, closeArgv);
-
- Tcl_HandleFree (tSippGlobPtr->rleTblPtr, rleFilePtr);
- return result;
-
- } /* SippRLEClose */
-
- /*=============================================================================
- * RLECommentCmdSetup --
- * Utility procedure to set up for one of the comments commands. If converts
- * the rlehandle and validates the comment name.
- * Parameters:
- * o tSippGlobPtr (I) - A pointer to the Tcl SIPP global structure.
- * o handle (I) - A RLE handle.
- * o name (I) - The name of the commane. If NULL, then it is not validated
- * Returns:
- * A pointer to the RLE file entry, or NULL if an error occured. Errors
- * returned in tSippGlobPtr->interp->result.
- *-----------------------------------------------------------------------------
- */
- static rleFile_pt
- RLECommentCmdSetup (tSippGlobPtr, handle, name)
- tSippGlob_pt tSippGlobPtr;
- char *handle;
- char *name;
- {
- rleFile_pt rleFilePtr;
-
- rleFilePtr = RLEHandleToPtr (tSippGlobPtr, handle);
- if (rleFilePtr == NULL)
- return NULL;
-
- if ((name != NULL) && (strpbrk (name, " \f\n\r\t\v=") != NULL)) {
- Tcl_AppendResult (tSippGlobPtr->interp, "name may not contain the ",
- "`=' or whitespace characters", (char *) NULL);
- return NULL;
- }
- return rleFilePtr;
-
- } /* RLECommentCmdSetup */
-
- /*=============================================================================
- * SippRLEPutCom --
- * Implements the command:
- * SippRLEPutCom rlehandle name [value]
- * Note:
- * This procedure has standard Tcl command calling sematics. ClientData
- * contains a pointer to the Tcl SIPP global structure.
- *-----------------------------------------------------------------------------
- */
- static int
- SippRLEPutCom (clientData, interp, argc, argv)
- char *clientData;
- Tcl_Interp *interp;
- int argc;
- char **argv;
- {
- tSippGlob_pt tSippGlobPtr = (tSippGlob_pt) clientData;
- rleFile_pt rleFilePtr;
- int comStrLen;
- char *comStr, *oldComStr;
-
- if ((argc < 3) || (argc > 4)) {
- Tcl_AppendResult (interp, "wrong # args: ", argv [0],
- " rlehandle name [value]", (char *) NULL);
- return TCL_ERROR;
- }
- rleFilePtr = RLECommentCmdSetup (tSippGlobPtr, argv [1], argv [2]);
- if (rleFilePtr == NULL)
- return TCL_ERROR;
-
- if (argc == 3)
- comStrLen = strlen (argv [2]) + 1;
- else
- comStrLen = strlen (argv [2]) + strlen (argv [3]) + 2;
-
- comStr = malloc (comStrLen);
- strcpy (comStr, argv [2]);
- if (argc > 3 ) {
- strcat (comStr, "=");
- strcat (comStr, argv [3]);
- }
- oldComStr = rle_putcom (comStr, &rleFilePtr->rleHeader);
- if (oldComStr != NULL)
- free (oldComStr);
-
- return TCL_OK;
-
- } /* SippRLEPutCom */
-
- /*=============================================================================
- * SippRLEGetCom --
- * Implements the command:
- * SippRLEGetCom rlehandle name [retvar | {}]
- * Note:
- * This procedure has standard Tcl command calling sematics. ClientData
- * contains a pointer to the Tcl SIPP global structure.
- *-----------------------------------------------------------------------------
- */
- static int
- SippRLEGetCom (clientData, interp, argc, argv)
- char *clientData;
- Tcl_Interp *interp;
- int argc;
- char **argv;
- {
- tSippGlob_pt tSippGlobPtr = (tSippGlob_pt) clientData;
- rleFile_pt rleFilePtr;
- char *comStr;
-
- if ((argc < 3) || (argc > 4)) {
- Tcl_AppendResult (interp, "wrong # args: ", argv [0],
- " rlehandle name [retvar | {}]", (char *) NULL);
- return TCL_ERROR;
- }
-
- rleFilePtr = RLECommentCmdSetup (tSippGlobPtr, argv [1], argv [2]);
- if (rleFilePtr == NULL)
- return TCL_ERROR;
-
- comStr = rle_getcom (argv [2], &rleFilePtr->rleHeader);
-
- /*
- * If comment was not found, either return false or leave result an empty
- * string. If its was found, either return it in the variable or as the
- * command result.
- */
- if (comStr == NULL) {
- if (argc == 4)
- interp->result = "0";
- } else {
- if (argc == 4) {
- if (argv [3][0] != '\0') {
- if (Tcl_SetVar (interp, argv [3], comStr,
- TCL_LEAVE_ERR_MSG) == NULL)
- return TCL_ERROR;
- }
- interp->result = "1";
- } else {
- Tcl_SetResult (interp, comStr, TCL_STATIC);
- }
- }
- return TCL_OK;
-
- } /* SippRLEGetCom */
-
- /*=============================================================================
- * SippRLEDelCom --
- * Implements the command:
- * SippRLEDelCom rlehandle name
- * Note:
- * This procedure has standard Tcl command calling sematics. ClientData
- * contains a pointer to the Tcl SIPP global structure.
- *-----------------------------------------------------------------------------
- */
- static int
- SippRLEDelCom (clientData, interp, argc, argv)
- char *clientData;
- Tcl_Interp *interp;
- int argc;
- char **argv;
- {
- tSippGlob_pt tSippGlobPtr = (tSippGlob_pt) clientData;
- rleFile_pt rleFilePtr;
- char *comStr;
-
- if (argc != 3) {
- Tcl_AppendResult (interp, "wrong # args: ", argv [0],
- " rlehandle name", (char *) NULL);
- return TCL_ERROR;
- }
- rleFilePtr = RLECommentCmdSetup (tSippGlobPtr, argv [1], argv [2]);
- if (rleFilePtr == NULL)
- return TCL_ERROR;
-
- comStr = rle_delcom (argv [2], &rleFilePtr->rleHeader);
- if (comStr != NULL)
- free (comStr);
-
- return TCL_OK;
-
- } /* SippRLEDelCom */
-
- /*=============================================================================
- * RLEPixelRender --
- * Pixel rendering call back procedure. SIPP doesn't have the concept of
- * background and always involkes the call back for every pixel.
- *
- * Parameters:
- * o renderDataPtr (I) - A pointer to the clientdata, It contains a buffer
- * with the row of data currently being rendered.
- * o x, y (I) - The pixel coordinate.
- * o red, green, blue - (I) - The color values for the pixel.
- *-----------------------------------------------------------------------------
- */
- static void
- RLEPixelRender (renderDataPtr, x, y, red, green, blue)
- renderData_pt renderDataPtr;
- int x;
- int y;
- unsigned char red;
- unsigned char green;
- unsigned char blue;
- {
-
- renderDataPtr->rowPtr [RLE_RED] [x] = red;
- renderDataPtr->rowPtr [RLE_GREEN] [x] = green;
- renderDataPtr->rowPtr [RLE_BLUE] [x] = blue;
-
- if (x >= renderDataPtr->rleHdrPtr->xmax)
- rle_putrow (renderDataPtr->rowPtr, renderDataPtr->rleHdrPtr->xmax,
- renderDataPtr->rleHdrPtr);
-
- } /* RLEPixelRender */
-
- /*=============================================================================
- * RLERenderImage --
- * Render an image to a RLE file. The RLE file should have had all initial
- * setup performed.
- *
- * Parameters:
- * o tSippGlobPtr (I) - A pointer to the Tcl SIPP global structure.
- * o rleFilePtr (I) - A pointer to the RLE file entry.
- * o renderParmsPtr (I) - The rendering parameters parsed from the command
- * line.
- *-----------------------------------------------------------------------------
- */
- static void
- RLERenderImage (tSippGlobPtr, rleFilePtr, renderParmsPtr)
- tSippGlob_pt tSippGlobPtr;
- rleFile_pt rleFilePtr;
- tSippRenderParms_pt renderParmsPtr;
- {
- renderData_t renderData;
-
- /*
- * Set up the client-data with one scan line worth of buffer.
- */
- renderData.rleHdrPtr = &rleFilePtr->rleHeader;
- rle_row_alloc (&rleFilePtr->rleHeader, &renderData.rowPtr);
-
- if (renderParmsPtr->interlaced)
- render_field_func (renderParmsPtr->xSize,
- renderParmsPtr->ySize,
- RLEPixelRender,
- &renderData,
- renderParmsPtr->mode,
- renderParmsPtr->overSampling,
- renderParmsPtr->field);
- else
- render_image_func (renderParmsPtr->xSize,
- renderParmsPtr->ySize,
- RLEPixelRender,
- &renderData,
- renderParmsPtr->mode,
- renderParmsPtr->overSampling);
-
- rle_row_free (&rleFilePtr->rleHeader, renderData.rowPtr);
-
- } /* RLERenderImage */
-
- /*=============================================================================
- * RLEOutputBitMap --
- * Output a SIPP bit map to a RLE file. The scan lines are done in reverse
- * to account for the difference in the idea of which end is up between SIPP
- * and RLE.
- *
- * Parameters:
- * o tSippGlobPtr (I) - A pointer to the Tcl SIPP global structure.
- * o rleFilePtr (I) - Pointer to the RLE file entry, should be all set up
- * for rle_row_put.
- * o bitMapPtr (I) - Pointer to the SIPP bit map structure.
- *-----------------------------------------------------------------------------
- */
- static void
- RLEOutputBitMap (tSippGlobPtr, rleFilePtr, bitMapPtr)
- tSippGlob_pt tSippGlobPtr;
- rleFile_pt rleFilePtr;
- Sipp_bitmap *bitMapPtr;
- {
- rle_pixel **rowPtr;
- int x, y;
- unsigned bit;
- u_char *pixRowPtr;
- int lineColor [3], backgroundColor [3];
-
- lineColor [RLE_RED] = tSippGlobPtr->lineColor.red * 255;
- lineColor [RLE_GREEN] = tSippGlobPtr->lineColor.grn * 255;
- lineColor [RLE_BLUE] = tSippGlobPtr->lineColor.blu * 255;
-
- backgroundColor [RLE_RED] = tSippGlobPtr->backgroundColor.red * 255;
- backgroundColor [RLE_GREEN] = tSippGlobPtr->backgroundColor.grn * 255;
- backgroundColor [RLE_BLUE] = tSippGlobPtr->backgroundColor.blu * 255;
-
- rle_row_alloc (&rleFilePtr->rleHeader, &rowPtr);
-
- for (y = rleFilePtr->rleHeader.ymax - 1; y >= 0 ; y--) {
- pixRowPtr = &bitMapPtr->buffer [y * bitMapPtr->width_bytes];
-
- for (x = 0; x < rleFilePtr->rleHeader.xmax; x++) {
- bit = (pixRowPtr [x >> 3] >> (7-(x & 7))) & 1;
- if (bit) {
- rowPtr [RLE_RED] [x] = lineColor [RLE_RED];
- rowPtr [RLE_GREEN] [x] = lineColor [RLE_GREEN];
- rowPtr [RLE_BLUE] [x] = lineColor [RLE_BLUE];
- } else {
- rowPtr [RLE_RED] [x] = backgroundColor [RLE_RED];
- rowPtr [RLE_GREEN] [x] = backgroundColor [RLE_GREEN];
- rowPtr [RLE_BLUE] [x] = backgroundColor [RLE_BLUE];
- }
- }
- rle_putrow (rowPtr, rleFilePtr->rleHeader.xmax,
- &rleFilePtr->rleHeader);
- }
-
- rle_row_free (&rleFilePtr->rleHeader, rowPtr);
-
- } /* RLEOutputBitMap */
-
- /*=============================================================================
- * RLEDrawImage --
- * Render a line image to a RLE file. The RLE file should have had all
- * initial setup performed.
- *
- * Parameters:
- * o tSippGlobPtr (I) - A pointer to the Tcl SIPP global structure.
- * o rleFilePtr (I) - A pointer to the RLE file entry.
- * o renderParmsPtr (I) - The rendering parameters parsed from the command
- * line.
- *-----------------------------------------------------------------------------
- */
- static void
- RLEDrawImage (tSippGlobPtr, rleFilePtr, renderParmsPtr)
- tSippGlob_pt tSippGlobPtr;
- rleFile_pt rleFilePtr;
- tSippRenderParms_pt renderParmsPtr;
- {
- Sipp_bitmap *bitMapPtr;
-
- /*
- * Create bit map and use the standard SIPP call back to draw the lines.
- */
- bitMapPtr = sipp_bitmap_create (renderParmsPtr->xSize,
- renderParmsPtr->ySize);
- render_image_func (renderParmsPtr->xSize,
- renderParmsPtr->ySize,
- sipp_bitmap_line,
- bitMapPtr,
- LINE, 0);
-
- RLEOutputBitMap (tSippGlobPtr, rleFilePtr, bitMapPtr);
-
- sipp_bitmap_destruct (bitMapPtr);
-
- } /* RLEDrawImage */
-
- /*=============================================================================
- * SippRLERender --
- * Implements the command:
- * SippRLERender rlehandle xsize ysize [mode] [oversample]
- * Note:
- * This procedure has standard Tcl command calling sematics. ClientData
- * contains a pointer to the Tcl SIPP global structure.
- *-----------------------------------------------------------------------------
- */
- static int
- SippRLERender (clientData, interp, argc, argv)
- char *clientData;
- Tcl_Interp *interp;
- int argc;
- char **argv;
- {
- tSippGlob_pt tSippGlobPtr = (tSippGlob_pt) clientData;
- rleFile_pt rleFilePtr;
- int background [3];
- tSippRenderParms_t renderParms;
- char *versionStr, *oldVersionStr;
-
- if (!TSippParseRenderParms (tSippGlobPtr, argc, argv, "rlehandle",
- &renderParms))
- return TCL_ERROR;
-
- rleFilePtr = RLEHandleToPtr (tSippGlobPtr, renderParms.fileHandle);
- if (rleFilePtr == NULL)
- return TCL_ERROR;
-
- /*
- * RLE expects scan lines in the reverse order of standard SIPP algorithm.
- */
- sipp_render_direction (TRUE);
-
- /*
- * Set up the RLE header for a 24 bit image and write it.
- */
- rleFilePtr->rleHeader.ncolors = 3; /* Red, Green and Blue */
- rleFilePtr->rleHeader.xmin = 0;
- rleFilePtr->rleHeader.xmax = renderParms.xSize - 1;
- rleFilePtr->rleHeader.ymin = 0;
- rleFilePtr->rleHeader.ymax = renderParms.ySize - 1;
-
- RLE_SET_BIT (rleFilePtr->rleHeader, RLE_RED);
- RLE_SET_BIT (rleFilePtr->rleHeader, RLE_GREEN);
- RLE_SET_BIT (rleFilePtr->rleHeader, RLE_BLUE);
-
- background [RLE_RED] = tSippGlobPtr->backgroundColor.red;
- background [RLE_GREEN] = tSippGlobPtr->backgroundColor.grn;
- background [RLE_BLUE] = tSippGlobPtr->backgroundColor.blu;
-
- rleFilePtr->rleHeader.bg_color = background;
- rleFilePtr->rleHeader.background = 2; /* Use background color */
-
- /*
- * Add Tcl-SIPP version command and command history to the header.
- */
-
- versionStr = malloc (strlen (TSIPP_VERSION) + 15);
- strcpy (versionStr, "TSIPP_VERSION=");
- strcat (versionStr, TSIPP_VERSION);
- oldVersionStr = rle_putcom (versionStr, &rleFilePtr->rleHeader);
- if (oldVersionStr != NULL)
- free (oldVersionStr);
-
- rle_addhist (argv, (rle_hdr *) 0, &rleFilePtr->rleHeader);
-
- rle_put_setup (&rleFilePtr->rleHeader);
-
- if (renderParms.mode == LINE)
- RLEDrawImage (tSippGlobPtr, rleFilePtr, &renderParms);
- else
- RLERenderImage (tSippGlobPtr, rleFilePtr, &renderParms);
-
- rle_puteof (&rleFilePtr->rleHeader);
-
- return TCL_OK;
-
- } /* SippRLERender */
-
- /*=============================================================================
- * TSippRLEInit --
- * Initialized the Utah Raster Toolkit RLE commands and the RLE file
- * table.
- *
- * Parameters:
- * o tSippGlobPtr (I) - A pointer to the Tcl SIPP global structure.
- *-----------------------------------------------------------------------------
- */
- void
- TSippRLEInit (tSippGlobPtr)
- tSippGlob_pt tSippGlobPtr;
- {
- static tSippTclCmdTbl_t cmdTable [] = {
- {"SippRLEOpen", SippRLEOpen},
- {"SippRLEClose", SippRLEClose},
- {"SippRLEPutCom", SippRLEPutCom},
- {"SippRLEGetCom", SippRLEGetCom},
- {"SippRLEDelCom", SippRLEDelCom},
- {"SippRLERender", SippRLERender},
- {NULL, NULL}
- };
-
- tSippGlobPtr->rleTblPtr =
- Tcl_HandleTblInit ("rlefile", sizeof (rleFile_t), 4);
-
- TSippInitCmds (tSippGlobPtr, cmdTable);
-
- } /* TSippRLEInit */
-
- #else /* TSIPP_NO_RLE */
-
- /*=============================================================================
- * SippRLEIsNotHere --
- * Implements the a command that returns a error indicates that the Utah
- * Raster Toolkit is not available. If this module is compiled with
- * TSIPP_NO_RLE defined, all RLE commands are bound to this command.
- *
- * Note:
- * This procedure has standard Tcl command calling sematics. ClientData
- * contains a pointer to the Tcl SIPP global structure.
- *-----------------------------------------------------------------------------
- */
- static int
- SippRLEIsNotHere (clientData, interp, argc, argv)
- char *clientData;
- Tcl_Interp *interp;
- int argc;
- char **argv;
- {
- Tcl_AppendResult (interp, "The Utah Raster Toolkit RLE library has not ",
- "been linked into\n", "this program. ", argv [0],
- " is not available", (char *) NULL);
- return TCL_ERROR;
-
- } /* SippRLEIsNotHere */
-
- /*=============================================================================
- * TSippRLEInit --
- * Initialization when the Utah Raster Toolkit is not available. Bind all
- * commands to a routine that returns an error.
- *
- * Parameters:
- * o tSippGlobPtr (I) - A pointer to the Tcl SIPP global structure.
- *-----------------------------------------------------------------------------
- */
- void
- TSippRLEInit (tSippGlobPtr)
- tSippGlob_pt tSippGlobPtr;
- {
- static tSippTclCmdTbl_t cmdTable [] = {
- {"SippRLEOpen", SippRLEIsNotHere},
- {"SippRLEClose", SippRLEIsNotHere},
- {"SippRLEPutCom", SippRLEIsNotHere},
- {"SippRLEGetCom", SippRLEIsNotHere},
- {"SippRLEDelCom", SippRLEIsNotHere},
- {"SippRLERender", SippRLEIsNotHere},
- {NULL, NULL}
- };
-
- tSippGlobPtr->rleTblPtr = NULL;
-
- TSippInitCmds (tSippGlobPtr, cmdTable);
-
- } /* TSippRLEInit */
-
- #endif /* TSIPP_NO_RLE */
-